## Replication package: Holy Cows

This repository contains all data and code needed to reproduce the figures and tables for the paper (PDF included separately). The main script `Paper_results.R` loads prepared data from `Data/`, runs all analyses, and saves outputs to `Figures/` and `Tables/` in the same order as presented in the paper.

### What this produces

Running `Paper_results.R` generates the following artifacts:

- Figures
	- `Figures/Figure1.svg` and `Figures/Figure1.png` – cover figure (drawn in Inkscape; already included).
	- `Figures/Figure2.png` – Mission houses constructed by decade (Trap vs. Larsen (2005)) and cumulative share.
	- `Figures/Figure3.png` – Grid heatmap of potential Inner Mission influence with mission house locations overlaid.
	- `Figures/Figure4.png` – Sunday-closed creameries over time with total creameries (dual axis).
	- `Figures/Figure5.png` – Binscatter of residualized MB ratio on residualized IM.
	- `Figures/Figure6a.png` – Heterogeneity: region × IM interaction.
	- `Figures/Figure6b.png` – Heterogeneity: distance to Copenhagen deciles × IM.
	- `Figures/Figure6c.png` – Heterogeneity: herd size (cows) deciles × IM.
	- `Figures/Figure6d.png` – Heterogeneity: shareholders deciles × IM.
	- `Figures/Figure6e.png` – Heterogeneity: local population density deciles × IM.
	- `Figures/Figure6f.png` – Heterogeneity: local boulder clay (ML share) octiles × IM.

- Tables (LaTeX)
	- `Tables/Table1.tex` – Summary statistics for main variables.
	- `Tables/Table2.tex` – Main specification: OLS and IV with clustered and Conley (50km) standard errors; includes conversion of IM effect into 2010 USD equivalents.
	- `Tables/Table3.tex` – Pre-period determinants of IM (population), with and without FE.
	- `Tables/Table4.tex` – Alternative intensity measures of mission presence (dummy, distance, 25km count, inverse sqrt decay).
	- `Tables/Table5.tex` – Mechanisms and outcomes (Sabbatarian, dividends, shareholders, collection routes, parish consolidation).


## How to run

1) Open this folder as your working directory in R or RStudio (the script uses relative paths like `Data/...`, `Figures/...`, `Tables/...`).

2) Install the required R packages if you don’t already have them:
	 - tidyverse
	 - fixest
	 - kableExtra
	 - foreach
	 - gginnards
	 - fastDummies

	 The script will also source a helper used to convert MB ratios into real values:
	 - `Converting MB ratios to real value/changeMB_ratio_to_real_values.R`

3) Source and run `Paper_results.R`. It will:
	 - Load all prepared datasets from `Data/`.
	 - Create figures and write them to `Figures/`.
	 - Estimate models and write LaTeX output to `Tables/`.

Notes:
- The Conley standard errors are computed via `vcov = conley(cutoff = 50)` from fixest.
- Figure 1 is prepared in Inkscape and already included; all other figures are generated by the script.
- Table outputs are .tex files ready to be included in a LaTeX manuscript.


## Data files (prepared)

All data needed to run the script are included under `Data/`:

- `Regression_data.csv` – Panel of creamery-level outcomes and covariates used in the main regressions.
- `Mission_house_construction.csv` – Decadal construction counts for mission houses (Trap source) used in Figure 2.
- `Mission_houses_panel.csv` – Mission house panel with coordinates used for maps (Figure 3) and intensity measures.
- `grid_panel.csv` – Grid-level panel used to build the potential influence surface (Figure 3).
- `Sab_summary_data.csv` – Time series of Sunday-closed vs total creameries for Figure 4.
- `Pre_data.csv` – Pre-period data (e.g., population) used in Table 3.
- `Parish_data.csv` – Parish-level outcomes used in Table 5 (column 6).

The folder `Converting MB ratios to real value/` includes a small helper script and local price index files (`Priceindex_dst.csv` and `.xlsx`) used only to translate MB ratio effects into modern currency equivalents in Table 2. This does not affect the econometric estimates themselves.
